// Copyright  2004-2008 Backplane Ltd.
//
// This file is part of Ubiquity formsPlayer
//
// Ubiquity formsPlayer is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3 of the License, or (at your
// option) any later version.
//
// Ubiquity formsPlayer is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License
// along with Ubiquity formsPlayer If not, see <http://www.gnu.org/licenses/>.
//	
//
//   Purpose: declaration of CXFormsApp.
//   $Id$


#include "XFormsXFormsElement.h"
#include "XFormsManager.h"
#pragma once
class CXFormsApp : public CWinApp
{
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CXFormsApp)
	public:
    virtual BOOL InitInstance();
    virtual int ExitInstance();
	//}}AFX_VIRTUAL

	//{{AFX_MSG(CXFormsApp)
		// NOTE - the ClassWizard will add and remove member functions here.
		//    DO NOT EDIT what you see in these blocks of generated code !
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

public:
	HRESULT reportError(const char* sText, CXFormsXFormsElement* pForm = NULL);

	CXFormsXFormsElement * m_pXForms;

	 //only need one of these, it is really a kind of factory.

	IXPathEvaluator * m_pEvaluator;

	CComBSTR m_sXFormsURI;
	CComBSTR m_sXFormsURI_NovellHack;
	CComBSTR m_sOldXFormsURI;
	CComBSTR m_sObjectDeclaration;
	inline CXFormsManager& FormsManager(void);
private:
	CXFormsManager theManager;
public:
	// <summary>Initialises the various variables used by the forms, called by form constructors, should only run once</summary>
	HRESULT InitForUse(void);

	CComBSTR m_bsLastSplash;
};

inline CXFormsManager& CXFormsApp::FormsManager(void)
{
	return theManager;
}
